/**
 * name: '', 名称
 * type: '', 类型, group：分组
 * fieldName: '', 字段名
 * fieldType: '', 字段类型：input, number, select, image
 * options: '', 字段类型为select时的选项值，多个以逗号分割
 * show: 是否显示，接收参数为data，当前已设置的值，无此函数时默认返回为true
 */
import { fontFamily } from './common.config';

const otherOption = {
  type: 'group',
  name: '其它设置',
  children: [
    {
      name: '其它配置',
      fieldName: 'jsonOption',
      fieldType: 'textarea',
      description: '此配置为json，配置内容请参考 echarts：https://echarts.apache.org/zh/option.html，示例：{\n' +
          '  title: [\n' +
          '    {\n' +
          '      text: \'Michelson-Morley Experiment\',\n' +
          '      left: \'center\', \n' +
          '      bottom: \'center\', \n' +
          '    },\n' +
          '    {\n' +
          '      text: \'upper: Q3 + 1.5 * IQR \\nlower: Q1 - 1.5 * IQR\',\n' +
          '      borderColor: \'#999\',\n' +
          '      borderWidth: 1,\n' +
          '      textStyle: {\n' +
          '        fontWeight: \'normal\',\n' +
          '        fontSize: 14,\n' +
          '        lineHeight: 20\n' +
          '      },\n' +
          '      left: \'10%\',\n' +
          '      top: \'90%\'\n' +
          '    }\n' +
          '  ]}'
    }
  ]
};

const echartsLine = [
  {
    name: '曲线',
    fieldName: 'smooth',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '展示点',
    fieldName: 'showSymbol',
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '点形状',
    fieldName: 'symbol',
    fieldType: 'select',
    show: (data) => data['showSymbol'],
    default: 'none',
    options: [
      {key: 'none', value: '无'},
      {key: 'emptyCircle', value: '空心圆'},
      {key: 'circle', value: '实心圆'},
      {key: 'rect', value: '正方形'},
      {key: 'roundRect', value: '圆角正方形'},
      {key: 'triangle', value: '三角形'},
      {key: 'diamond', value: '菱形'},
      {key: 'pin', value: '大头针'},
      {key: 'arrow', value: '箭头'},
    ]
  },
  {
    name: '点大小',
    fieldName: 'symbolSize',
    fieldType: 'number',
    default: 4,
    show: (data) => data['showSymbol']
  },
  {
    name: '展示线',
    fieldName: 'showLine',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '线粗细',
    fieldName: 'lineWidth',
    fieldType: 'number',
    default: 2,
    show: (data) => data['showLine']
  },
  {
    name: '填充',
    fieldName: 'showArea',
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '透明度',
    fieldName: 'opacity',
    fieldType: 'number',
    point: 1,
    default: 0.7,
    show: (data) => data['showArea'],
  }
];

const echartsBar = [
  {
    name: '隐藏柱图',
    fieldName: 'transparent',
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['type'] === 'bar'
  },
  {
    name: '柱图宽度',
    fieldName: 'barWidth',
    fieldType: 'input',
    show: (data) => data['type'] === 'bar' && !data['transparent'],
    description: '示例：10%，20px，可以是占比，也可以是像素'
  },
  {
    name: '显示标签',
    fieldName: 'label',
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['type'] === 'bar'
  },
  {
    name: '显示格式',
    fieldName: 'formatter',
    fieldType: 'input',
    description: '{a}：系列名。\n' +
      '{b}：数据名。\n' +
      '{c}：数据值。\n' +
      '{@xxx}：数据中名为 \'xxx\' 的维度的值，如 {@product} 表示名为 \'product\' 的维度的值。\n' +
      '{@[n]}：数据中维度 n 的值，如 {@[3]} 表示维度 3 的值，从 0 开始计数。\n' +
      '示例：{b}: {@score}',
    show: (data) => data['type'] === 'bar' && data['label']
  },
  {
    name: '字体颜色',
    fieldName: 'color',
    fieldType: 'color-picker',
    default: '{fontColor}',
    show: (data) => data['label']
  },
  {
    name: '字体风格',
    fieldName: 'fontStyle',
    fieldType: 'buttons',
    default: 'normal',
    options: [
      {key: 'normal', value: '正常'},
      {key: 'italic', value: '斜体'},
      {key: 'oblique', value: 'oblique'}
    ],
    show: (data) => data['label']
  },
  {
    name: '字体粗细',
    fieldName: 'fontWeight',
    fieldType: 'select',
    allowCreate: true,
    default: 'normal',
    options: [
      {key: 'normal', value: '正常'},
      {key: 'bold', value: '加粗'},
      {key: 'bolder', value: '超粗'},
      {key: 'lighter', value: '轻粗'}
    ],
    show: (data) => data['label']
  },
  {
    name: '字体样式',
    fieldName: 'fontFamily',
    fieldType: 'select',
    allowCreate: true,
    options: fontFamily,
    show: (data) => data['label']
  },
  {
    name: '字体大小',
    fieldName: 'fontSize',
    fieldType: 'number',
    default: 14,
    show: (data) => data['label']
  },
];

const chartsLineData = (type) => [
  {
    name: '',
    fieldName: 'seriesList',
    fieldType: 'style-list',
    default: [
      {
        name: '标签',
        dataType: 'label',
        prop: '标签'
      },
      {
        name: '系列',
        dataType: 'series',
        prop: '系列',
        type: type,
        smooth: true,
        showSymbol: false,
        symbolSize: 4,
        symbol: 'circle',
        showLine: true,
        lineWidth: 2,
        showArea: false,
        opacity: 0.7,
        transparent: false,
        label: false
      },
    ],
    options: [
      {
        type: 'group',
        name: '数据系列',
        children: [
          {
            name: '名称',
            fieldName: 'name',
            fieldType: 'input',
          },
          {
            name: '数据类型',
            fieldName: 'dataType',
            fieldType: 'buttons',
            default: 'series',
            options: [
              {key: 'label', value: '标签数据'},
              {key: 'series', value: '系列数据'},
            ]
          },
          {
            name: '显示方式',
            fieldName: 'type',
            fieldType: 'buttons',
            show: (data) => data['dataType'] === 'series',
            default: type,
            options: [
              {key: 'line', value: '折线图'},
              {key: 'bar', value: '柱状图'},
            ]
          },
          {
            name: '显示内容',
            fieldName: 'prop',
            fieldType: 'select',
            optionsFieldList: true
          },
          {
            name: '堆叠',
            fieldName: 'stack',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '堆叠组名',
            fieldName: 'stackName',
            fieldType: 'input',
            default: '',
            show: (data) => data['stack']
          }
        ]
      },
      {
        type: 'group',
        name: '常用设置',
        show: (data) => data['type'] === 'line',
        children: echartsLine
      },
      {
        type: 'group',
        name: '常用设置',
        show: (data) => data['type'] === 'bar',
        children: echartsBar
      }
    ],
  },
];

const echartsTitle = [
  {
    name: '显示标题',
    fieldName: 'title.show',
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '标题内容',
    fieldName: 'title.text',
    fieldType: 'input',
    show: (data) => data['title.show']
  },
  {
    name: '标题边距',
    fieldName: 'title.padding',
    fieldType: 'multiple-number',
    number: 4,
    default: '15,0,0,15',
    description: '上,右,下,左',
    show: (data) => data['title.show']
  },
  {
    name: '垂直位置',
    fieldName: 'title.top',
    fieldType: 'buttons',
    default: 'top',
    options: [
      {key: 'top', value: '顶部'},
      {key: 'middle', value: '居中'},
      {key: 'bottom', value: '底部'},
    ],
    show: (data) => data['title.show']
  },
  {
    name: '水平位置',
    fieldName: 'title.left',
    fieldType: 'buttons',
    default: 'left',
    options: [
      {key: 'left', value: '居左'},
      {key: 'center', value: '居中'},
      {key: 'right', value: '居右'},
    ],
    show: (data) => data['title.show']
  },
  {
    name: '字体颜色',
    fieldName: 'title.textStyle.color',
    fieldType: 'color-picker',
    default: '{fontColor}',
    show: (data) => data['title.show']
  },
  {
    name: '字体风格',
    fieldName: 'title.textStyle.fontStyle',
    fieldType: 'buttons',
    default: 'normal',
    options: [
      {key: 'normal', value: '正常'},
      {key: 'italic', value: '斜体'},
      {key: 'oblique', value: 'oblique'}
    ],
    show: (data) => data['title.show']
  },
  {
    name: '字体粗细',
    fieldName: 'title.textStyle.fontWeight',
    fieldType: 'select',
    allowCreate: true,
    default: 'normal',
    options: [
      {key: 'normal', value: '正常'},
      {key: 'bold', value: '加粗'},
      {key: 'bolder', value: '超粗'},
      {key: 'lighter', value: '轻粗'}
    ],
    show: (data) => data['title.show']
  },
  {
    name: '字体样式',
    fieldName: 'title.textStyle.fontFamily',
    fieldType: 'select',
    allowCreate: true,
    options: fontFamily,
    show: (data) => data['title.show']
  },
  {
    name: '字体大小',
    fieldName: 'title.textStyle.fontSize',
    fieldType: 'number',
    default: 14,
    show: (data) => data['title.show']
  },
];

const echartsToolbox = [
  {
    name: '显示工具栏',
    fieldName: 'toolbox.show',
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '布局方式',
    fieldName: 'toolbox.orient',
    fieldType: 'buttons',
    default: 'horizontal',
    options: [
      {value: '水平', key: 'horizontal'},
      {value: '垂直', key: 'vertical'}
    ],
    show: (data) => data['toolbox.show']
  },
  {
    name: '图标大小',
    fieldName: 'toolbox.itemSize',
    fieldType: 'number',
    default: 15,
    show: (data) => data['toolbox.show']
  },
  {
    name: '图标间隔',
    fieldName: 'toolbox.itemGap',
    fieldType: 'number',
    default: 8,
    show: (data) => data['toolbox.show']
  },
  {
    name: '数据视图',
    fieldName: 'toolbox.feature.dataView.show',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['toolbox.show']
  },
  {
    name: '切换折线图',
    fieldName: 'toolbox.feature.magicType.line',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['toolbox.show']
  },
  {
    name: '切换柱状图',
    fieldName: 'toolbox.feature.magicType.bar',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['toolbox.show']
  },
  {
    name: '切换堆叠图',
    fieldName: 'toolbox.feature.magicType.stack',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['toolbox.show']
  },
  {
    name: '配置项还原',
    fieldName: 'toolbox.feature.restore.show',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['toolbox.show']
  },
  {
    name: '保存图片',
    fieldName: 'toolbox.feature.saveAsImage.show',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data['toolbox.show']
  }
];

const echartsLegend = [
  {
    name: '显示图例',
    fieldName: 'legend.show',
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '图例类型',
    fieldName: 'legend.type',
    fieldType: 'buttons',
    default: 'plain',
    options: [
      {key: 'plain', value: '普通'},
      {key: 'scroll', value: '滚动'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '水平位置',
    fieldName: 'legend.left',
    fieldType: 'buttons',
    default: 'center',
    options: [
      {key: 'left', value: '居左'},
      {key: 'center', value: '居中'},
      {key: 'right', value: '居右'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '垂直位置',
    fieldName: 'legend.top',
    fieldType: 'buttons',
    default: 'bottom',
    options: [
      {key: 'top', value: '顶部'},
      {key: 'middle', value: '中部'},
      {key: 'bottom', value: '低部'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '图例布局',
    fieldName: 'legend.orient',
    fieldType: 'buttons',
    default: 'horizontal',
    options: [
      {key: 'horizontal', value: '水平'},
      {key: 'vertical', value: '垂直'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '对齐方式',
    fieldName: 'legend.align',
    fieldType: 'buttons',
    default: 'auto',
    options: [
      {key: 'auto', value: '自动'},
      {key: 'left', value: '左对齐'},
      {key: 'right', value: '右对齐'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '宽度',
    fieldName: 'legend.width',
    fieldType: 'input',
    default: 'auto',
    show: (data) => data['legend.show']
  },
  {
    name: '高度',
    fieldName: 'legend.height',
    fieldType: 'input',
    default: 'auto',
    show: (data) => data['legend.show']
  },
  {
    name: '图例项间隔',
    fieldName: 'legend.itemGap',
    fieldType: 'number',
    default: 10,
    show: (data) => data['legend.show']
  },
  {
    name: '图例项宽度',
    fieldName: 'legend.itemWidth',
    fieldType: 'number',
    default: 25,
    show: (data) => data['legend.show']
  },
  {
    name: '图例项高度',
    fieldName: 'legend.itemHeight',
    fieldType: 'number',
    default: 14,
    show: (data) => data['legend.show']
  },
  {
    name: '字体颜色',
    fieldName: 'legend.textStyle.color',
    fieldType: 'color-picker',
    default: '{fontColor}',
    show: (data) => data['legend.show']
  },
  {
    name: '字体风格',
    fieldName: 'legend.textStyle.fontStyle',
    fieldType: 'buttons',
    default: 'normal',
    options: [
      {key: 'normal', value: '正常'},
      {key: 'italic', value: '斜体'},
      {key: 'oblique', value: 'oblique'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '字体粗细',
    fieldName: 'legend.textStyle.fontWeight',
    fieldType: 'select',
    allowCreate: true,
    default: 'normal',
    options: [
      {key: 'normal', value: '正常'},
      {key: 'bold', value: '加粗'},
      {key: 'bolder', value: '超粗'},
      {key: 'lighter', value: '轻粗'}
    ],
    show: (data) => data['legend.show']
  },
  {
    name: '字体样式',
    fieldName: 'legend.textStyle.fontFamily',
    fieldType: 'select',
    allowCreate: true,
    options: fontFamily,
    show: (data) => data['legend.show']
  },
  {
    name: '字体大小',
    fieldName: 'legend.textStyle.fontSize',
    fieldType: 'number',
    default: 14,
    show: (data) => data['legend.show']
  },
  {
    name: '图标类型',
    fieldName: 'legend.icon',
    fieldType: 'select',
    default: 'roundRect',
    options: [
      {key: 'circle', value: '圆形'},
      {key: 'rect', value: '长方形'},
      {key: 'roundRect', value: '圆角长方形'},
      {key: 'triangle', value: '三角形'},
      {key: 'diamond', value: '凌形'},
      {key: 'pin', value: '图钉形'},
      {key: 'arrow', value: '箭头'},
      {key: 'none', value: '无'}
    ],
    show: (data) => data['legend.show']
  }
];

const echartsAxis = (type, typeValue, boundaryGap) => [
  {
    name: `${type === 'xAxis' ? '横' : '纵'}轴类型`,
    fieldName: `${type}.type`,
    fieldType: 'buttons',
    default: typeValue,
    options: [
      {value: '类目轴', key: 'category'},
      {value: '数值轴', key: 'value'}
    ],
  },
  {
    name: '字体颜色',
    fieldName: `${type}.axisLabel.color`,
    fieldType: 'color-picker',
    default: '{fontColor}',
  },
  {
    name: '两边留空',
    fieldName: `${type}.boundaryGap`,
    fieldType: 'switch',
    default: boundaryGap,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.type`] === 'category'
  },
  {
    name: `显示${type === 'xAxis' ? '横' : '纵'}轴`,
    fieldName: `${type}.show`,
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '显示轴线',
    fieldName: `${type}.axisLine`,
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.show`],
  },
  {
    name: '轴线颜色',
    fieldName: `${type}.axisLine.color`,
    fieldType: 'color-picker',
    show: (data) => data[`${type}.show`] && data[`${type}.axisLine`]
  },
  {
    name: '显示刻度线',
    fieldName: `${type}.axisTick`,
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.show`]
  },
  {
    name: '与标签对齐',
    fieldName: `${type}.axisTick.alignWithLabel`,
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.show`] && data[`${type}.axisTick`],
  },
  {
    name: '显示网格线',
    fieldName: `${type}.splitLine`,
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.show`]
  },
  {
    name: '网格线颜色',
    fieldName: `${type}.splitLine.color`,
    fieldType: 'color-picker',
    show: (data) => data[`${type}.show`] && data[`${type}.splitLine`]
  },
  {
    name: '显示轴标签',
    fieldName: `${type}.axisLabel`,
    fieldType: 'switch',
    default: true,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.show`]
  },
  {
    name: '宽度',
    fieldName: `${type}.axisLabel.width`,
    fieldType: 'number',
    default: 300,
    show: (data) => data[`${type}.show`] && data[`${type}.axisLabel`]
  },
  {
    name: '旋转角度',
    fieldName: `${type}.axisLabel.rotate`,
    fieldType: 'number',
    default: 0,
    show: (data) => data[`${type}.show`] && data[`${type}.axisLabel`]
  },
  {
    name: '自动刻度',
    fieldName: `${type}.scale`,
    fieldType: 'switch',
    default: false,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
    show: (data) => data[`${type}.type`] === 'value'
  },
  {
    name: '最小值',
    fieldName: `${type}.min`,
    fieldType: 'number',
    show: (data) => data[`${type}.type`] === 'value' && !data[`${type}.scale`]
  },
  {
    name: '最大值',
    fieldName: `${type}.max`,
    fieldType: 'number',
    show: (data) => data[`${type}.type`] === 'value' && !data[`${type}.scale`]
  },
  {
    name: '刻度数',
    fieldName: `${type}.splitNumber`,
    fieldType: 'number',
    show: (data) => data[`${type}.type`] === 'value'
  }
];

export const echartsTooltip = (show, trigger) => [
  {
    name: '是否显示',
    fieldName: 'tooltip.show',
    fieldType: 'switch',
    default: show,
    options: [
      {value: '', key: true},
      {value: '', key: false}
    ],
  },
  {
    name: '触发类型',
    fieldName: 'tooltip.trigger',
    fieldType: 'buttons',
    default: trigger,
    options: [
      {value: '数据项', key: 'item'},
      {value: '坐标轴', key: 'axis'}
    ],
    show: data => data['tooltip.show']
  },
  {
    name: '显示格式',
    fieldName: 'tooltip.formatter',
    fieldType: 'input',
    description: '折线图、柱状图、K线图 : {a}（系列名称），{b}（类目值），{c}（数值）, {d}（无）\n' +
        '散点图 : {a}（系列名称），{b}（数据名称），{c}（数值数组）, {d}（无）\n' +
        '地图 : {a}（系列名称），{b}（区域名称），{c}（合并数值）, {d}（无）\n' +
        '饼图、仪表盘、漏斗图: {a}（系列名称），{b}（数据项名称），{c}（数值）, {d}（百分比）\n' +
        '示例：{b0}: {c0}<br />{b1}: {c1}',
    show: data => data['tooltip.show']
  },
  {
    name: '字体颜色',
    fieldName: 'tooltip.color',
    fieldType: 'color-picker',
    show: data => data['tooltip.show']
  },
  {
    name: '背景颜色',
    fieldName: 'tooltip.backgroundColor',
    fieldType: 'color-picker',
    default: '#FFFFFF',
    show: data => data['tooltip.show']
  },
  {
    name: '边框颜色',
    fieldName: 'tooltip.borderColor',
    fieldType: 'color-picker',
    show: data => data['tooltip.show']
  }
];

export const dataListConfig = {
  inputData: true,
  fieldList: '标签,系列',
  dataList: [
    {"标签": "周一", "系列": 10, "系列1": 20, "系列2": 30},
    {"标签": "周二", "系列": 20, "系列1": 30, "系列2": 40},
    {"标签": "周三", "系列": 30, "系列1": 40, "系列2": 50},
    {"标签": "周四", "系列": 40, "系列1": 50, "系列2": 60},
    {"标签": "周五", "系列": 50, "系列1": 60, "系列2": 70},
    {"标签": "周六", "系列": 60, "系列1": 70, "系列2": 80},
    {"标签": "周日", "系列": 70, "系列1": 80, "系列2": 90},
  ]
};

export const dataRadarConfig = {
  inputData: true,
  fieldList: '标签,最大值,系列',
  dataList: [
    {"标签": "周一", "最大值": 100, "系列": 10, "系列1": 20, "系列2": 30},
    {"标签": "周二", "最大值": 110, "系列": 20, "系列1": 30, "系列2": 40},
    {"标签": "周三", "最大值": 120, "系列": 30, "系列1": 40, "系列2": 50},
    {"标签": "周四", "最大值": 130, "系列": 40, "系列1": 50, "系列2": 60},
    {"标签": "周五", "最大值": 140, "系列": 50, "系列1": 60, "系列2": 70},
    {"标签": "周六", "最大值": 150, "系列": 60, "系列1": 70, "系列2": 80},
    {"标签": "周日", "最大值": 160, "系列": 70, "系列1": 80, "系列2": 90},
  ]
};

export const dataMapConfig = {
  inputData: true,
  fieldList: '系列',
  dataList: [
    {
      "系列": [
        {"name": "北京市", "value": 100},
        {"name": "天津市", "value": 110},
        {"name": "河北省", "value": 120},
        {"name": "山西省", "value": 130},
        {"name": "内蒙古自治区", "value": 140},
        {"name": "辽宁省", "value": 150},
        {"name": "吉林省", "value": 160},
      ]
    }
  ]
};

export const dataArrayConfig = {
  inputData: true,
  fieldList: '系列',
  dataList: [
    {
      "系列": [
        [10.0, 8.04],
        [8.07, 6.95],
        [13.0, 7.58],
        [9.05, 8.81],
        [11.0, 8.33],
        [14.0, 7.66],
        [13.4, 6.81],
        [10.0, 6.33]
      ]
    },
  ]
}

export const dataConfig = {
  inputData: true,
  fieldList: '标签,系列',
  dataList: [
    {"标签": "周一", "系列": 10, "系列1": 20, "系列2": 30}
  ]
}

export const echarts = [
  {
    name: '折线图',
    type: 'echarts-line',
    height: '300px',
    ...dataListConfig,
    eventList: '点击坐标轴事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '边距',
            fieldName: 'padding',
            fieldType: 'multiple-input',
            number: 4,
            default: '50px,20px,30px,20px',
            description: '上,右,下,左：示例：100px, 5%',
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(true, 'axis'),
        ]
      },
      {
        type: 'group',
        name: '图例配置',
        children: [
          ...echartsLegend,
        ]
      },
      {
        type: 'group',
        name: '横轴设置',
        children: [
          ...echartsAxis('xAxis', 'category', false),
        ]
      },
      {
        type: 'group',
        name: '纵轴设置',
        children: [
          ...echartsAxis('yAxis', 'value', false),
        ]
      },
      {
        type: 'group',
        name: '数据配置',
        children: chartsLineData('line')
      },
      otherOption
    ]
  },
  {
    name: '柱状图',
    type: 'echarts-bar',
    height: '300px',
    ...dataListConfig,
    eventList: '点击坐标轴事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '边距',
            fieldName: 'padding',
            fieldType: 'multiple-input',
            number: 4,
            default: '50px,20px,30px,20px',
            description: '上,右,下,左：示例：100px, 5%',
          },
          {
            name: '渐变颜色',
            fieldName: 'colorGradient',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '透明度',
            fieldName: 'colorTransparency',
            fieldType: 'number',
            max: 100,
            default: 100,
            show: data => data['colorGradient']
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(true, 'axis'),
        ]
      },
      {
        type: 'group',
        name: '图例配置',
        children: [
          ...echartsLegend,
        ]
      },
      {
        type: 'group',
        name: '横轴设置',
        children: [
          ...echartsAxis('xAxis', 'category', true),
        ]
      },
      {
        type: 'group',
        name: '纵轴设置',
        children: [
          ...echartsAxis('yAxis', 'value', true),
        ]
      },
      {
        type: 'group',
        name: '数据配置',
        children: chartsLineData('bar')
      },
      otherOption
    ]
  },
  {
    name: '环状图',
    type: 'echarts-annular',
    height: '300px',
    inputData: true,
    fieldList: '百分比,显示值,标题',
    dataList: [{"百分比": 30, "显示值": "30%", "标题": "完成率"}],
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '进度条颜色',
            fieldName: 'progressColor',
            fieldType: 'color-picker',
            default: '#5470c6',
          },
          {
            name: '数值颜色',
            fieldName: 'series.value.color',
            fieldType: 'color-picker',
            default: '#5470c6',
          },
          {
            name: '字体大小',
            fieldName: 'series.value.fontSize',
            fieldType: 'number',
            default: 14
          },
          {
            name: '字体样式',
            fieldName: 'series.value.fontFamily',
            fieldType: 'select',
            allowCreate: true,
            options: fontFamily
          },
          {
            name: '字体加粗',
            fieldName: 'series.value.fontWeight',
            fieldType: 'select',
            default: 'normal',
            allowCreate: true,
            options: [
              {value: 'normal', key: 'normal'},
              {value: 'bold', key: 'bold'},
              {value: 'bolder', key: 'bolder'},
              {value: 'lighter', key: 'lighter'},
            ],
          },
          {
            name: '标题颜色',
            fieldName: 'series.title.color',
            fieldType: 'color-picker',
            default: '#5470c6',
          },
          {
            name: '字体大小',
            fieldName: 'series.title.fontSize',
            fieldType: 'number',
            default: 14
          },
          {
            name: '字体样式',
            fieldName: 'series.title.fontFamily',
            fieldType: 'select',
            allowCreate: true,
            options: fontFamily
          },
          {
            name: '字体加粗',
            fieldName: 'series.title.fontWeight',
            fieldType: 'select',
            default: 'normal',
            allowCreate: true,
            options: [
              {value: 'normal', key: 'normal'},
              {value: 'bold', key: 'bold'},
              {value: 'bolder', key: 'bolder'},
              {value: 'lighter', key: 'lighter'},
            ],
          },
          {
            name: '底框大小',
            fieldName: 'borderWidth',
            fieldType: 'number',
            default: 8
          },
          {
            name: '底框颜色',
            fieldName: 'borderColor',
            fieldType: 'color-picker',
            default: '',
          }
        ]
      },
      otherOption
    ]
  },
  {
    name: '饼图',
    type: 'echarts-pie',
    height: '300px',
    ...dataListConfig,
    eventList: '点击数据项事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '边距',
            fieldName: 'padding',
            fieldType: 'multiple-input',
            number: 4,
            default: '10px,10px,10px,10px',
            description: '上,右,下,左：示例：100px, 5%',
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(true, 'item'),
        ]
      },
      {
        type: 'group',
        name: '图例配置',
        children: [
          ...echartsLegend,
        ]
      },
      {
        type: 'group',
        name: '饼图配置',
        children: [
          {
            name: '字体颜色',
            fieldName: 'series.color',
            fieldType: 'color-picker',
            default: '#FFFFFF',
          },
          {
            name: '显示格式',
            fieldName: 'series.formatter',
            fieldType: 'input',
            description: '折线图、柱状图、K线图 : {a}（系列名称），{b}（类目值），{c}（数值）, {d}（无）\n' +
                '散点图 : {a}（系列名称），{b}（数据名称），{c}（数值数组）, {d}（无）\n' +
                '地图 : {a}（系列名称），{b}（区域名称），{c}（合并数值）, {d}（无）\n' +
                '饼图、仪表盘、漏斗图: {a}（系列名称），{b}（数据项名称），{c}（数值）, {d}（百分比）\n' +
                '示例：{b0}: {c0}<br />{b1}: {c1}'
          },
          {
            name: '间隔角度',
            fieldName: 'series.padAngle',
            fieldType: 'number',
            default: 0,
            description: '饼图扇区之间的间隔角度（0 ~ 360）。'
          },
          {
            name: '饼图半径',
            fieldName: 'series.radius',
            fieldType: 'multiple-input',
            number: 2,
            default: '0,80%',
            description: '数组的第一项是内半径，第二项是外半径。示例：0, 75%',
          },
          {
            name: '圆角半径',
            fieldName: 'series.borderRadius',
            fieldType: 'multiple-input',
            number: 4,
            default: '0,0,0,0',
            description: '配置从内到外顺时针方向四个角的圆角半径，百分比值从相对于内外扇形的半径更改为相对于内外扇形的半径差。示例：100, 5%',
          },
          {
            name: '南丁格尔图',
            fieldName: 'series.rose',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false},
            ],
          },
          {
            name: '南丁格尔图',
            fieldName: 'series.roseType',
            fieldType: 'select',
            default: 'radius',
            options: [
              {key: 'radius', value: '扇区圆心角展现数据的百分比'},
              {key: 'area', value: '所有扇区圆心角相同'},
            ],
            show: (data) => data['series.rose']
          },
        ]
      },
      otherOption
    ]
  },
  {
    name: '仪表盘',
    height: '300px',
    type: 'echarts-gauge',
    ...dataConfig,
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '仪表盘配置',
        children: [
          {
            name: '仪表盘半径',
            fieldName: 'series.radius',
            fieldType: 'input',
            default: '75%',
          },
          {
            name: '起始角度',
            fieldName: 'series.startAngle',
            fieldType: 'number',
            default: 225,
          },
          {
            name: '结束角度',
            fieldName: 'series.endAngle',
            fieldType: 'number',
            default: -45,
          },
          {
            name: '最小值',
            fieldName: 'series.minAngle',
            fieldType: 'number',
            default: 0,
          },
          {
            name: '最大值',
            fieldName: 'series.maxAngle',
            fieldType: 'number',
            default: 100,
          },
          {
            name: '分割段数',
            fieldName: 'series.splitNumber',
            fieldType: 'number',
            default: 10,
          },
          {
            name: '显示轴线',
            fieldName: 'series.axisLine',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '轴线大小',
            fieldName: 'series.axisLine.width',
            fieldType: 'number',
            default: 10,
            show: data => data['series.axisLine']
          },
          {
            name: '轴线颜色',
            fieldName: 'series.axisLine.color',
            fieldType: 'input',
            description: '仪表盘的轴线可以被分成不同颜色的多段。0.1,red,0.2,#ff00ff...：0-10%红色，10%-20%#ff00ff颜色',
            show: data => data['series.axisLine']
          },
          {
            name: '显示进度条',
            fieldName: 'series.progress',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '进度条大小',
            fieldName: 'series.progress.width',
            fieldType: 'number',
            default: 10,
            show: data => data['series.progress']
          },
          {
            name: '显示分割线',
            fieldName: 'series.splitLine',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '分割线距离',
            fieldName: 'series.splitLine.distance',
            fieldType: 'number',
            default: 10,
            show: (data) => data['series.splitLine']
          },
          {
            name: '分割线颜色',
            fieldName: 'series.splitLine.color',
            fieldType: 'color-picker',
            default: '#63677A',
            show: (data) => data['series.splitLine']
          },
          {
            name: '显示刻度',
            fieldName: 'series.axisTick',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '刻度距离',
            fieldName: 'series.axisTick.distance',
            fieldType: 'number',
            default: 10,
            show: (data) => data['series.axisTick']
          },
          {
            name: '刻度颜色',
            fieldName: 'series.axisTick.color',
            fieldType: 'color-picker',
            default: '#63677A',
            show: (data) => data['series.axisTick']
          },
          {
            name: '显示标签',
            fieldName: 'series.axisLabel',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '显示指针',
            fieldName: 'series.pointer',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '指针颜色',
            fieldName: 'series.pointer.color',
            fieldType: 'color-picker',
            default: '#1E90FF',
            show: (data) => data['series.pointer']
          },
          {
            name: '显示标题',
            fieldName: 'series.title',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ]
          },
          {
            name: '标题位置',
            fieldName: 'series.title.offset',
            fieldType: 'input',
            default: '0%,20%',
            description: '相对于仪表盘中心的偏移位置，数组第一项是水平方向的偏移，第二项是垂直方向的偏移。可以是绝对的数值，也可以是相对于仪表盘半径的百分比。'
          },
          {
            name: '显示详情',
            fieldName: 'series.detail',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ]
          },
          {
            name: '详情格式',
            fieldName: 'series.detail.formatter',
            fieldType: 'input',
            description: '格式化函数或者字符串，{value}：系列值',
            show: (data) => data['series.detail']
          },
          {
            name: '字体大小',
            fieldName: 'series.detail.fontSize',
            fieldType: 'number',
            default: 14,
            show: (data) => data['series.detail']
          },
          {
            name: '详情颜色',
            fieldName: 'series.detail.color',
            fieldType: 'color-picker',
            show: (data) => data['series.detail']
          }
        ]
      },
      otherOption
    ]
  },
  {
    name: '散点图',
    type: 'echarts-scatter',
    height: '300px',
    ...dataArrayConfig,
    eventList: '点击数据项事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '边距',
            fieldName: 'padding',
            fieldType: 'multiple-input',
            number: 4,
            default: '50px,20px,30px,20px',
            description: '上,右,下,左：示例：100px, 5%',
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(true, 'axis'),
        ]
      },
      {
        type: 'group',
        name: '图例配置',
        children: [
          ...echartsLegend,
        ]
      },
      {
        type: 'group',
        name: '横轴设置',
        children: [
          ...echartsAxis('xAxis', 'value', false),
        ]
      },
      {
        type: 'group',
        name: '纵轴设置',
        children: [
          ...echartsAxis('yAxis', 'value', false),
        ]
      },
      {
        type: 'group',
        name: '散点图配置',
        children: [
          {
            name: '标记图形',
            fieldName: 'series.symbol',
            fieldType: 'select',
            default: 'circle',
            options: [
              {key: 'circle', value: '圆形'},
              {key: 'rect', value: '正方形'},
              {key: 'roundRect', value: '圆角正方形'},
              {key: 'triangle', value: '三角形'},
              {key: 'diamond', value: '菱形'},
              {key: 'pin', value: '大头针'},
              {key: 'arrow', value: '箭头'},
            ]
          },
          {
            name: '标记大小',
            fieldName: 'series.symbolSize',
            fieldType: 'number',
            default: 10
          }
        ]
      },
      {
        type: 'group',
        name: '数据配置',
        children: [
          {
            name: '',
            fieldName: 'seriesList',
            fieldType: 'style-list',
            default: [
              {
                name: '系列',
                prop: '系列',
              },
            ],
            options: [
              {
                type: 'group',
                name: '数据系列',
                children: [
                  {
                    name: '名称',
                    fieldName: 'name',
                    fieldType: 'input',
                  },
                  {
                    name: '显示内容',
                    fieldName: 'prop',
                    fieldType: 'select',
                    optionsFieldList: true
                  }
                ]
              }
            ],
          },
        ]
      },
      otherOption
    ]
  },
  {
    name: '雷达图',
    type: 'echarts-radar',
    height: '300px',
    ...dataRadarConfig,
    eventList: '点击数据项事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(false, 'item'),
        ]
      },
      {
        type: 'group',
        name: '图例配置',
        children: [
          ...echartsLegend,
        ]
      },
      {
        type: 'group',
        name: '数据配置',
        children: [
          {
            name: '',
            fieldName: 'seriesList',
            fieldType: 'style-list',
            default: [
              {
                name: '标签',
                dataType: 'label',
                prop: '标签',
              },
              {
                name: '最大值',
                dataType: 'maxValue',
                prop: '最大值'
              },
              {
                name: '系列',
                dataType: 'series',
                prop: '系列'
              },
            ],
            options: [
              {
                type: 'group',
                name: '数据系列',
                children: [
                  {
                    name: '名称',
                    fieldName: 'name',
                    fieldType: 'input',
                  },
                  {
                    name: '数据类型',
                    fieldName: 'dataType',
                    fieldType: 'buttons',
                    default: 'series',
                    options: [
                      {key: 'label', value: '标签数据'},
                      {key: 'maxValue', value: '最大值数据'},
                      {key: 'series', value: '系列数据'},
                    ]
                  },
                  {
                    name: '显示内容',
                    fieldName: 'prop',
                    fieldType: 'select',
                    optionsFieldList: true
                  }
                ]
              }
            ],
          },
        ]
      },
      {
        type: 'group',
        name: '雷达图配置',
        children: [
          {
            name: '雷达大小',
            fieldName: 'series.radius',
            fieldType: 'input',
            default: '75%',
            description: '雷达大小，示例：100：100px，75%：按比例占比'
          },
          {
            name: '显示标签',
            fieldName: 'series.axisName',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '标签颜色',
            fieldName: 'series.axisName.color',
            fieldType: 'color-picker',
            default: '{fontColor}',
            show: (data) => data['series.axisName']
          },
          {
            name: '显示轴线',
            fieldName: 'series.axisLine',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '轴线颜色',
            fieldName: 'series.axisLine.color',
            fieldType: 'color-picker',
            default: '#ccc',
            show: (data) => data['series.axisLine']
          },
          {
            name: '显示分割线',
            fieldName: 'series.splitLine',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '分割线颜色',
            fieldName: 'series.splitLine.color',
            fieldType: 'color-picker',
            default: '#ccc',
            show: (data) => data['series.splitLine']
          },
          {
            name: '标记形状',
            fieldName: 'series.symbol',
            fieldType: 'select',
            default: 'none',
            options: [
              {key: 'none', value: '无'},
              {key: 'circle', value: '圆形'},
              {key: 'rect', value: '正方形'},
              {key: 'roundRect', value: '圆角正方形'},
              {key: 'triangle', value: '三角形'},
              {key: 'diamond', value: '菱形'},
              {key: 'pin', value: '大头针'},
              {key: 'arrow', value: '箭头'},
            ]
          },
          {
            name: '标记大小',
            fieldName: 'series.symbolSize',
            fieldType: 'number',
            default: 4,
            show: data => !data['series.symbol'] || data['series.symbol'] !== 'none'
          },
          {
            name: '填充',
            fieldName: 'series.area',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '透明度',
            fieldName: 'series.area.opacity',
            fieldType: 'number',
            point: 1,
            default: 0.7,
            show: (data) => data['series.area'],
          },
        ]
      },
      otherOption
    ]
  },
  {
    name: '漏斗图',
    type: 'echarts-funnel',
    height: '300px',
    ...dataListConfig,
    fieldList: '标签,系列',
    eventList: '点击数据项事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(false, 'item'),
        ]
      },
      {
        type: 'group',
        name: '图例配置',
        children: [
          ...echartsLegend,
        ]
      },
      {
        type: 'group',
        name: '漏斗图配置',
        children: [
          {
            name: '边距',
            fieldName: 'margin',
            fieldType: 'multiple-number',
            number: 4,
            default: '10,0,30,0',
            description: '上,右,下,左'
          },
          {
            name: '最小值',
            fieldName: 'series.min',
            fieldType: 'number',
            default: 0
          },
          {
            name: '最大值',
            fieldName: 'series.max',
            fieldType: 'number',
            default: 100
          },
          {
            name: '最小宽度',
            fieldName: 'series.minSize',
            fieldType: 'input',
            default: '0%'
          },
          {
            name: '最大值宽度',
            fieldName: 'series.maxSize',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '数据排序',
            fieldName: 'series.sort',
            fieldType: 'buttons',
            default: 'descending',
            options: [
              {value: '升序', key: 'ascending'},
              {value: '降序', key: 'descending'}
            ]
          },
          {
            name: '漏斗朝向',
            fieldName: 'series.orient',
            fieldType: 'buttons',
            default: 'vertical',
            options: [
              {value: '垂直', key: 'vertical'},
              {value: '水平', key: 'horizontal'}
            ]
          },
          {
            name: '对齐方式',
            fieldName: 'series.funnelAlign',
            fieldType: 'buttons',
            default: 'center',
            options: [
              {value: '居左', key: 'left'},
              {value: '居中', key: 'center'},
              {value: '居右', key: 'right'},
            ],
            show: data => data['series.orient'] === 'vertical'
          },
          {
            name: '对齐方式',
            fieldName: 'series.funnelAlign',
            fieldType: 'buttons',
            default: 'center',
            options: [
              {value: '居上', key: 'top'},
              {value: '居中', key: 'center'},
              {value: '居下', key: 'bottom'},
            ],
            show: data => data['series.orient'] === 'horizontal'
          },
          {
            name: '图形间距',
            fieldName: 'series.gap',
            fieldType: 'number',
            default: 0
          },
          {
            name: '显示标签',
            fieldName: 'series.label',
            fieldType: 'switch',
            default: true,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '标签位置',
            fieldName: 'series.position',
            fieldType: 'buttons',
            default: 'inside',
            options: [
              {value: '左侧', key: 'left'},
              {value: '内部', key: 'inside'},
              {value: '右侧', key: 'right'}
            ],
            show: data => data['series.orient'] === 'vertical'
          },
          {
            name: '标签位置',
            fieldName: 'series.position',
            fieldType: 'buttons',
            default: 'inside',
            options: [
              {value: '上侧', key: 'top'},
              {value: '内部', key: 'inside'},
              {value: '下侧', key: 'bottom'}
            ],
            show: data => data['series.orient'] === 'horizontal'
          }
        ]
      },
      otherOption
    ]
  },
  {
    name: '地图',
    type: 'echarts-map',
    height: '300px',
    ...dataMapConfig,
    eventList: '点击数据项事件',
    styleList: [
      {
        type: 'group',
        name: '基础设置',
        children: [
          {
            name: '动画',
            fieldName: 'animation',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '宽度',
            fieldName: 'width',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '高度',
            fieldName: 'height',
            fieldType: 'input',
            default: '100%'
          },
          {
            name: '颜色方案',
            fieldName: 'colorScheme',
            fieldType: 'color-scheme',
            default: '{"name": "default"}'
          },
        ],
      },
      {
        type: 'group',
        name: '标题配置',
        children: [
          ...echartsTitle,
        ]
      },
      {
        type: 'group',
        name: '工具栏配置',
        children: [
          ...echartsToolbox,
        ]
      },
      {
        type: 'group',
        name: '提示框配置',
        children: [
          ...echartsTooltip(false, 'item'),
        ]
      },
      {
        type: 'group',
        name: '地图配置',
        children: [
          {
            name: '显示区域',
            fieldName: 'geo.mapId',
            fieldType: 'area-select',
            checkStrictly: true,
            default: '156'
          },
          {
            name: '区域颜色',
            fieldName: 'geo.itemStyle.areaColor',
            fieldType: 'color-picker',
            default: '#eee',
          },
          {
            name: '选中颜色',
            fieldName: 'geo.itemStyle.activeColor',
            fieldType: 'color-picker',
          },
          {
            name: '描边颜色',
            fieldName: 'geo.itemStyle.borderColor',
            fieldType: 'color-picker',
            default: '#B7B9BE',
          },
          {
            name: '描边线宽',
            fieldName: 'geo.itemStyle.borderWidth',
            fieldType: 'number',
            default: 1,
          },
          {
            name: '描边类型',
            fieldName: 'geo.itemStyle.borderType',
            fieldType: 'select',
            default: 'solid',
            options: [
              {key: 'solid', value: '实线'},
              {key: 'dashed', value: '虚线'},
              {key: 'dotted', value: '点线'},
            ]
          },
          {
            name: '显示标签',
            fieldName: 'geo.label',
            fieldType: 'switch',
            default: false,
            options: [
              {value: '', key: true},
              {value: '', key: false}
            ],
          },
          {
            name: '标签位置',
            fieldName: 'geo.label.position',
            fieldType: 'select',
            default: 'inside',
            options: 'top,left,right,bottom,inside,insideLeft,insideRight,insideTop,insideBottom,insideTopLeft,insideBottomLeft,insideTopRight,insideBottomRight',
            show: data => data['geo.label']
          },
          {
            name: '标签偏移量',
            fieldName: 'geo.label.distance',
            fieldType: 'number',
            default: 5,
            show: data => data['geo.label']
          },
          {
            name: '标签格式',
            fieldName: 'geo.label.formatter',
            fieldType: 'input',
            default: '{a}',
            description: '{a}：系列名。\n' +
                '{b}：数据名。\n' +
                '{c}：数据值。\n' +
                '{@xxx}：数据中名为 \'xxx\' 的维度的值，如 {@product} 表示名为 \'product\' 的维度的值。\n' +
                '{@[n]}：数据中维度 n 的值，如 {@[3]} 表示维度 3 的值，从 0 开始计数。',
            show: data => data['geo.label']
          },
          {
            name: '标签字体颜色',
            fieldName: 'geo.label.color',
            fieldType: 'color-picker',
            default: '#fff',
            show: data => data['geo.label']
          },
          {
            name: '标签字体大小',
            fieldName: 'geo.label.fontSize',
            fieldType: 'number',
            default: 12,
            show: data => data['geo.label']
          }
        ]
      },
      {
        type: 'group',
        name: '视觉配置',
        children: [{
          name: '',
          fieldName: 'visualMapList',
          fieldType: 'style-list',
          default: [
            {
              name: '视觉',
              show: true,
              seriesIndex: 0,
              type: 'continuous',
              min: 0,
              max: 1000,
              orient: 'horizontal',
              text: '高,低',
              'inRange.symbol': 'pin',
              'inRange.color': '#deebf7,#3182bd'
            }
          ],
          options: [{
            type: 'group',
            name: '视觉配置',
            children: [
              {
                name: '名称',
                fieldName: 'name',
                fieldType: 'input',
              },
              {
                name: '视觉映射柱',
                fieldName: 'show',
                fieldType: 'switch',
                default: false,
                options: [
                  {value: '', key: true},
                  {value: '', key: false}
                ],
              },
              {
                name: '映射柱方向',
                fieldName: 'orient',
                fieldType: 'buttons',
                default: 'horizontal',
                options: [
                  {key: 'vertical', value: '垂直'},
                  {key: 'horizontal', value: '水平'},
                ],
                show: data => data['show']
              },
              {
                name: '映射柱文本',
                fieldName: 'text',
                fieldType: 'input',
                default: '高,低',
                show: data => data['show']
              },
              {
                name: '系列索引',
                fieldName: 'seriesIndex',
                fieldType: 'number',
                default: 0,
                description: '显示视觉映射哪个系列的数据，系列索引从0开始'
              },
              {
                name: '显示类型',
                fieldName: 'type',
                fieldType: 'buttons',
                default: 'continuous',
                options: [
                  {key: 'continuous', value: '连续型'},
                  {key: 'piecewise', value: '分段型'},
                ]
              },
              {
                name: '最小值',
                fieldName: 'min',
                fieldType: 'number',
                default: 0
              },
              {
                name: '最大值',
                fieldName: 'max',
                fieldType: 'number',
                default: 200
              },
              {
                name: '维度索引',
                fieldName: 'dimension',
                fieldType: 'number',
                description: '指定用数据【series.data】的【哪个维度】，映射到视觉元素上。不填时默认使用最后一个。'
              },
              {
                name: '标记类型',
                fieldName: 'inRange.symbol',
                fieldType: 'select',
                default: 'pin',
                options: [
                  {key: 'circle', value: '圆形'},
                  {key: 'rect', value: '长方形'},
                  {key: 'roundRect', value: '圆角长方形'},
                  {key: 'triangle', value: '三角形'},
                  {key: 'diamond', value: '凌形'},
                  {key: 'pin', value: '图钉形'},
                  {key: 'arrow', value: '箭头'},
                  {key: 'none', value: '无'}
                ],
              },
              {
                name: '标记大小',
                fieldName: 'inRange.symbolSize',
                fieldType: 'input',
                default: '20,20',
                description: '渐变大小以“,”逗号分割，如：10,30'
              },
              {
                name: '标记颜色',
                fieldName: 'inRange.color',
                fieldType: 'input',
                default: '#deebf7,#3182bd',
                description: '多个颜色代码以“,”逗号分割，如：red,#000'
              }
            ]
          }]
        }],
      },
      {
        type: 'group',
        name: '数据配置',
        children: [{
          name: '',
          fieldName: 'seriesList',
          fieldType: 'style-list',
          default: [
            {
              name: '系列',
              type: 'map',
              prop: '系列',
            }
          ],
          options: [{
            type: 'group',
            name: '系列配置',
            children: [
              {
                name: '名称',
                fieldName: 'name',
                fieldType: 'input',
              },
              {
                name: '显示类型',
                fieldName: 'type',
                fieldType: 'buttons',
                default: 'map',
                options: [
                  {key: 'map', value: '地图'},
                  {key: 'scatter', value: '散点'},
                ]
              },
              {
                name: '显示内容',
                fieldName: 'prop',
                fieldType: 'select',
                optionsFieldList: true
              },
            ]
          }]
        }],
      },
      otherOption
    ]
  },
]